package com.wechat.order.dataobject;

import com.wechat.order.enums.ProductStatusEnum;
import com.wechat.order.util.EnumUtil;
import lombok.Data;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * Created by zzy on 2017/12/13.
 */
@Table(name = "tb_product_info")
@Entity
@Data
public class ProductInfo implements Serializable{


    private static final long serialVersionUID = -6075477251664585336L;
    @Id
    private String productId;

    private String productName;

    private BigDecimal productPrice;

    private Integer productStock;

    private String productDescription;

    private String productIcon;

    private Integer productStatus;

    private Integer categoryType;

    private Date createTime;

    private Date updateTime;

    public ProductStatusEnum getProductStatusEnum(){
        return EnumUtil.getByCode(productStatus,ProductStatusEnum.class);
    }
}
